﻿using Spring.Testing.NUnit;

namespace OpenSda.Agilcont.Common.Business.SfContexts.NmTest
{
    public abstract class AbstractBaseDataTests : AbstractTransactionalSpringContextTests
    {
        protected override string[] ConfigLocations
        {
            get
            {
                return new string[]
                    {
                        "assembly://OpenSda.Agilcont.Common.Data.NhContexts/OpenSda.Agilcont.Common.Data.NhContexts/DataFactoryContext.xml",
                        "assembly://OpenSda.Agilcont.Common.Business.SfContexts/OpenSda.Agilcont.Common.Business.SfContexts/Services.xml"
                    };
            }
        }

        //protected ISessionFactory sessionFactory;
        //public ISessionFactory SessionFactory
        //{
        //    set { sessionFactory = value; }
        //}

        //protected override void OnSetUpInTransaction()
        //{

        //    //base.OnSetUpInTransaction();
        //    //Assert.IsNotNull(sessionFactory);
        //    ////sessionFactory.GetCurrentSession().Transaction
        //    //sessionFactory.GetCurrentSession().FlushMode = FlushMode.Always;
        //    //sessionFactory.GetCurrentSession().CacheMode = CacheMode.Ignore;
        //}
        protected override void OnSetUpBeforeTransaction()
        {
            DefaultRollback = false;
        }

    }
}
